function addQuestionDialog(callback = Function()) {
    const $form = $(`
        <form class="mask-account" style="overflow: auto;overflow-x: hidden">
            <div style="margin: 0">
                <span class="mask-account-tit"><sub style="color: red;">*</sub> 标题</span>
                <span class="input-select"><input type="text" name="questionTitle" placeholder="请输入标题" /></span>
            </div>
            <div>
                <span class="mask-account-tit">简介</span>
                <span class="input-select"><input type="text" name="questionIntro" placeholder="请输入简介" /></span>
            </div>
            <div>
                <span class="mask-account-tit">广告图</span>
                <div class="input-select" style="border: 0;padding: 0">
                    <input type="hidden" name="adImgUrl">
                </div>
            </div>
            <div>
                <span class="mask-account-tit"><sub style="color: red;">*</sub> 金额</span>
                <span class="input-select"><input type="number" name="price" placeholder="请输入报名金额(元)" /></span>
            </div>
            <div>
                <span class="mask-account-tit">排序</span>
                <span class="input-select"><input value="10" type="number" name="sortIndex" placeholder="排序,小的排前面" /></span>
            </div>
            <div>
                <span class="mask-account-tit">状态</span>
                <span data-select="disableFlag"></span>
            </div>
            <div>
                <span class="mask-account-tit">问卷内容</span>
                <div class="input-select" data-widget="queForm"  style="">
                </div>
            </div>
        </form>
    `)

    $form.find('[data-select="disableFlag"]').append($.getSelect("disableFlag", [
        {name: "启用", value: 0},
        {name: "停用", value: 1},
    ]));

    const $adImgUrlInput = $form.find('input[name="adImgUrl"]');

    $adImgUrlInput.after(getUploadImgWidget({
        maxCount: 1,
        maxSize: 1024 * 5,
        callback(urlList) {
            $adImgUrlInput.val(urlList.join(","))
        }
    }));


    const formBuilder = questionFormBuilder();
    const $queFormWidget = $form.find('[data-widget="queForm"]')
    $queFormWidget.html(formBuilder.$dom);
    $queFormWidget.hover(function () {
        $(this).css({border: "1px solid #E9EFF4"})
    });


    const $dialogWidget = $.dialog($form, {
        title: "新增问卷",
        width: "90%",
        init: () => {
            $form.css("max-height", $(window).height() * 0.7);
        },
        ok: () => {
            const data = $.getFormData($form);

            if (formBuilder.rowList.length) {
                data.formJsonStr = JSON.stringify(formBuilder.rowList);
            }

            if (data.price) {
                data.price *= 100;
            }

            addQuestion(data, ({Code, Message}) => {
                if (Code !== 10000) {
                    return $.toast(Message);
                }

                $dialogWidget.remove();
                $.toast("新增成功");

                callback();
            })

            return false;

        }
    })

    return $dialogWidget;


    function addQuestion(data, callback = Function()) {
        return $.sApi({
            data,
            url: "/api/Question/addQuestion"
        }, callback)
    }
}